﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BattleshipGameClient
{
    public partial class Message : Form
    {
        public delegate void MessageCallback();
        MessageCallback callback;

        public Message(string title, string msg, MessageCallback cb) : this (title, msg)
        {
            this.callback = cb;
            this.Closing += new CancelEventHandler(closing_event);
        }

        public Message(string title, string msg)
        {
            InitializeComponent();
            text.Text = msg;
            this.Text = title;
        }

        private void closing_event(object sender, System.ComponentModel.CancelEventArgs e) {
            callback();
        }

        private void btnAccept_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
